package com.example.justbuy.service.Impl;

import com.example.justbuy.mapper.ShoppingCartMapper;
import com.example.justbuy.pojo.Goods;
import com.example.justbuy.pojo.ShoppingCart;
import com.example.justbuy.service.ShoppingCartMapperService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class ShoppingcCartMapperServiceImpl implements ShoppingCartMapperService {

    @Autowired
    private ShoppingCartMapper shoppingCartMapper;

    @Override
    public List<ShoppingCart> getAllShoppingCartByuserId(int id) {
        return shoppingCartMapper.getAllShoppingCartByuserId(id);
    }

    @Override
    public int deleShoppingCartByGoodsId(int goodsid) {
        return shoppingCartMapper.deleShoppingCartByGoodsId(goodsid);
    }

    @Override
    public int addOneOfInfoToShoppingCartByGoodsId(Map map) {
        return shoppingCartMapper.addOneOfInfoToShoppingCartByGoodsId(map);
    }


    @Override
    public int deleAllOfShoppingCartByUserId(int userid) {
        return shoppingCartMapper.deleAllOfShoppingCartByUserId(userid);
    }

    @Override
    public int updateOfShoppingCartBygoodsId(Map map) {
        return shoppingCartMapper.updateOfShoppingCartBygoodsId(map);
    }

    @Override
    public Double getAllpriceByGoodsid(Map map) {
        return shoppingCartMapper.getAllpriceByGoodsid(map);
    }

    @Override
    public ShoppingCart getOneofShoppingCart(Map map) {
        return shoppingCartMapper.getOneofShoppingCart(map);
    }

    @Override
    public int deleOfShoppingCartByUserIdAndGoodSId(Map map) {
        return shoppingCartMapper.deleOfShoppingCartByUserIdAndGoodSId(map);
    }

    @Override
    public Goods getTheGoodsById(int id) {
        return shoppingCartMapper.getTheGoodsById(id);
    }
}
